package cn.lliiooll.ippzonetoolbox.ui.home;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import cn.lliiooll.ippzonetoolbox.R;
import com.alibaba.android.arouter.launcher.ARouter;

public class HomeFragment extends Fragment {

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ARouter.init(this.getActivity().getApplication());
    }

    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_home, container, false);
        Button nowm = root.findViewById(R.id.button_home_nowm);
        nowm.setBackgroundResource(R.drawable.ic_home_button_24dp);
        nowm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ARouter.getInstance().build("/ipp/input").withString("type", "nowm").navigation();
            }
        });
        Button find = root.findViewById(R.id.button_home_find);
        find.setBackgroundResource(R.drawable.ic_home_button_24dp);
        find.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ARouter.getInstance().build("/ipp/input").withString("type", "find").navigation();
            }
        });
        return root;
    }
}
